VFG.PPoint=function(viewer, options,collection) {
	this.viewer = viewer;
	this.options = options;
	this.collection=collection;
	this.parentId= options.parentId||'';
	this.id= options.id;
	this.name= options.name||'';
	this.code= options.code||'';
	this.type= options.type||'';
	this.position=options.position||null;
	this.orientation=options.orientation||{};
	
	this.thing=options.thing||{};
	
	this.attribute=options.attribute||{};
	this.propertys=options.propertys||[];
	this.init();
}

VFG.PPoint.prototype.init = function() {
	
	if(this.thing.bShow=='1'){
		this.bPrimitive=this.viewer.scene.primitives.get(2).add(this.getBillboard());
	}
	
	if(this.thing.lShow=='1'){
		this.lPrimitive=this.viewer.scene.primitives.get(1).add(this.getLabel());
	}
	
	if(this.thing.pShow=='1'){
		this.pPrimitive=this.viewer.scene.primitives.get(0).add(this.getPoint());
	}
	
};


VFG.PPoint.prototype.getBillboard=function(){
	let param={
		id:this.id,
		image :this.thing.image,
		scale:this.thing.scale||1 ,
	}
	if(this.thing.height){
		param.height=this.thing.height *1
	}
	
	if(this.thing.width){
		param.width=this.thing.width *1
	}
	param.position = this.getPosition();
	param.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;
	
	if(this.thing.isBScaleByDistance=='1' ){
		param.scaleByDistance=new Cesium.NearFarScalar(
			this.thing.bScaleByDistanceNear? this.thing.bScaleByDistanceNear*1: this.position.z*1,
			this.thing.bScaleByDistanceNearValue? this.thing.bScaleByDistanceNearValue*1: 1,
			this.thing.bScaleByDistanceFar? this.thing.bScaleByDistanceFar*1: 10000,
			this.thing.bScaleByDistanceFarValue? this.thing.bScaleByDistanceFarValue*1: 0);
	}
	
	if(this.thing.isBTranslucencyByDistance=='1' ){
		param.translucencyByDistance=new Cesium.NearFarScalar(
			this.thing.bTranslucencyByDistanceNear? this.thing.bTranslucencyByDistanceNear*1: this.position.z*1,
			this.thing.bTranslucencyByDistanceNearValue? this.thing.bTranslucencyByDistanceNearValue*1: 1,
			this.thing.bTranslucencyByDistanceFar? this.thing.bTranslucencyByDistanceFar*1: 10000,
			this.thing.bTranslucencyByDistanceFarValue? this.thing.bTranslucencyByDistanceFarValue*1: 0);
	}
	return param;
	
}

VFG.PPoint.prototype.updateBScaleByDistance=function(param){
	
	if(param.near){
		this.thing.bScaleByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.bScaleByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.bScaleByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.bScaleByDistanceFarValue=param.farValue
	}
	if(param.isBScaleByDistance){
		this.thing.isBScaleByDistance=param.isScaleByDistance
	}
	if(!this.bPrimitive){
		return;
	}
	if(this.thing.isBScaleByDistance=='1' ){
		this.bPrimitive.scaleByDistance=new Cesium.NearFarScalar(
			this.thing.bScaleByDistanceNear? this.thing.bScaleByDistanceNear*1: this.position.z*1,
			this.thing.bScaleByDistanceNearValue? this.thing.bScaleByDistanceNearValue*1: 1,
			this.thing.bScaleByDistanceFar? this.thing.bScaleByDistanceFar*1: 10000,
			this.thing.bScaleByDistanceFarValue? this.thing.bScaleByDistanceFarValue*1: 0);
	}else{
		this.bPrimitive.scaleByDistance=undefined;
	}
}

VFG.PPoint.prototype.updateBTranslucencyByDistance=function(param){
	
	if(param.near){
		this.thing.bTranslucencyByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.bTranslucencyByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.bTranslucencyByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.bTranslucencyByDistanceFarValue=param.farValue
	}
	if(param.isTranslucencyByDistance){
		this.thing.isBTranslucencyByDistance=param.isTranslucencyByDistance
	}
	
	if(!this.bPrimitive){
		return;
	}
	
	if(this.thing.isBTranslucencyByDistance=='1' ){
		this.bPrimitive.translucencyByDistance=new Cesium.NearFarScalar(
			this.thing.bTranslucencyByDistanceNear? this.thing.bTranslucencyByDistanceNear*1: this.position.z*1,
			this.thing.bTranslucencyByDistanceNearValue? this.thing.bTranslucencyByDistanceNearValue*1: 1,
			this.thing.bTranslucencyByDistanceFar? this.thing.bTranslucencyByDistanceFar*1: 10000,
			this.thing.bTranslucencyByDistanceFarValue? this.thing.bTranslucencyByDistanceFarValue*1: 0);
	}else{
		this.bPrimitive.translucencyByDistance=undefined;
	}
}


VFG.PPoint.prototype.getLabel=function(){
	
	let param={
		id:this.id,
		text :this.name,
		font :(this.thing.lFontSize?this.thing.lFontSize:'13px') +" "+(this.thing.lFontFamily?this.thing.lFontFamily:'sans-serif'),
		scale :this.thing.lScale ? this.thing.lScale*1:1,
	}

	if(this.thing.lShowBackground && '1'==this.thing.lShowBackground){
		param.showBackground=true
	}
	
	if(this.thing.lBackgroundColor ){
		param.backgroundColor=this.thing.lBackgroundColor ? Cesium.Color.fromCssColorString(this.thing.lBackgroundColor):Cesium.Color.YELLOW 
	}
	
	if(this.thing.lOutlineWidth){
		param.outlineWidth=this.thing.lOutlineWidth *1
	}
	if(this.thing.lOutlineColor ){
		param.outlineColor=this.thing.lOutlineColor ? Cesium.Color.fromCssColorString(this.thing.lOutlineColor):Cesium.Color.YELLOW 
	}
	
	param.pixelOffset=new Cesium.Cartesian2(this.thing.lPOffsetX*1||0,this.thing.lPOffsetY*1||0);

	
	if(this.thing.lStyle ){
		if('FILL'==this.thing.lStyle ){
			param.style=Cesium.LabelStyle.FILL
		}
		if('FILL_AND_OUTLINE'==this.thing.lStyle  ){
			param.style=Cesium.LabelStyle.FILL_AND_OUTLINE
		}
		if('OUTLINE'==this.thing.lStyle){
			param.style=Cesium.LabelStyle.OUTLINE
		}
	}
	
	if(this.thing.lHorizontalOrigin){
		if('CENTER'==this.thing.lHorizontalOrigin){
			param.horizontalOrigin=Cesium.HorizontalOrigin.CENTER
		}
		
		if('LEFT'==this.thing.lHorizontalOrigin){
			param.horizontalOrigin=Cesium.HorizontalOrigin.LEFT 
		}
		
		if('RIGHT'==this.thing.lHorizontalOrigin){
			param.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT
		}
	}
	
	if(this.thing.lVerticalOrigin ){
		if('BASELINE'==this.thing.lVerticalOrigin ){
			param.verticalOrigin=Cesium.VerticalOrigin.BASELINE 
		}
		if('BOTTOM'==this.thing.lVerticalOrigin ){
			param.verticalOrigin=Cesium.VerticalOrigin.BOTTOM 
		}
		if('CENTER'==this.thing.lVerticalOrigin ){
			param.verticalOrigin=Cesium.VerticalOrigin.CENTER  
		}
		if('TOP'==this.thing.lVerticalOrigin ){
			param.verticalOrigin=Cesium.VerticalOrigin.TOP  
		}
	}	
	param.position = this.getPosition();
	
	if(this.thing.isLScaleByDistance=='1' ){
		param.scaleByDistance=new Cesium.NearFarScalar(
			this.thing.lScaleByDistanceNear? this.thing.lScaleByDistanceNear*1: this.position.z*1,
			this.thing.lScaleByDistanceNearValue? this.thing.lScaleByDistanceNearValue*1: 1,
			this.thing.lScaleByDistanceFar? this.thing.lScaleByDistanceFar*1: 10000,
			this.thing.lScaleByDistanceFarValue? this.thing.lScaleByDistanceFarValue*1: 0);
	}
	
	if(this.thing.isLTranslucencyByDistance=='1' ){
		param.translucencyByDistance=new Cesium.NearFarScalar(
			this.thing.lTranslucencyByDistanceNear? this.thing.lTranslucencyByDistanceNear*1: this.position.z*1,
			this.thing.lTranslucencyByDistanceNearValue? this.thing.lTranslucencyByDistanceNearValue*1: 1,
			this.thing.lTranslucencyByDistanceFar? this.thing.lTranslucencyByDistanceFar*1: 10000,
			this.thing.lTranslucencyByDistanceFarValue? this.thing.lTranslucencyByDistanceFarValue*1: 0);
	}
	
	if(this.thing.isLPixelOffsetScaleByDistance=='1' ){
		param.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(
			this.thing.lPixelOffsetScaleByDistanceNear? this.thing.lPixelOffsetScaleByDistanceNear*1: this.position.z*1,
			this.thing.lPixelOffsetScaleByDistanceNearValue? this.thing.lPixelOffsetScaleByDistanceNearValue*1: 1,
			this.thing.lPixelOffsetScaleByDistanceFar? this.thing.lPixelOffsetScaleByDistanceFar*1: 10000,
			this.thing.lPixelOffsetScaleByDistanceFarValue? this.thing.lPixelOffsetScaleByDistanceFarValue*1: 0);
	}
	return param;
}

VFG.PPoint.prototype.updateLScaleByDistance=function(param){
	
	if(param.near){
		this.thing.lScaleByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.lScaleByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.lScaleByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.lScaleByDistanceFarValue=param.farValue
	}
	if(param.isScaleByDistance){
		this.thing.isLScaleByDistance=param.isScaleByDistance
	}
	if(!this.lPrimitive){
		return;
	}
	
	if(this.thing.isLScaleByDistance=='1' ){
		this.lPrimitive.scaleByDistance=new Cesium.NearFarScalar(
			this.thing.lScaleByDistanceNear? this.thing.lScaleByDistanceNear*1: this.position.z*1,
			this.thing.lScaleByDistanceNearValue? this.thing.lScaleByDistanceNearValue*1: 1,
			this.thing.lScaleByDistanceFar? this.thing.lScaleByDistanceFar*1: 10000,
			this.thing.lScaleByDistanceFarValue? this.thing.lScaleByDistanceFarValue*1: 0);
	}else{
		this.lPrimitive.scaleByDistance=undefined;
	}
}

VFG.PPoint.prototype.updateLTranslucencyByDistance=function(param){
	if(param.near){
		this.thing.lTranslucencyByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.lTranslucencyByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.lTranslucencyByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.lTranslucencyByDistanceFarValue=param.farValue
	}
	if(param.isTranslucencyByDistance){
		this.thing.isLTranslucencyByDistance=param.isTranslucencyByDistance
	}
	
	if(!this.lPrimitive){
		return;
	}
	
	if(this.thing.isLTranslucencyByDistance=='1' ){
		this.lPrimitive.translucencyByDistance=new Cesium.NearFarScalar(
			this.thing.lTranslucencyByDistanceNear? this.thing.lTranslucencyByDistanceNear*1: this.position.z*1,
			this.thing.lTranslucencyByDistanceNearValue? this.thing.lTranslucencyByDistanceNearValue*1: 1,
			this.thing.lTranslucencyByDistanceFar? this.thing.lTranslucencyByDistanceFar*1: 10000,
			this.thing.lTranslucencyByDistanceFarValue? this.thing.lTranslucencyByDistanceFarValue*1: 0);
	}else{
		this.lPrimitive.translucencyByDistance=undefined;
	}
}

VFG.PPoint.prototype.updateLPixelOffsetScaleByDistance=function(param){
	
	if(param.near){
		this.thing.lPixelOffsetScaleByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.lPixelOffsetScaleByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.lPixelOffsetScaleByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.lPixelOffsetScaleByDistanceFarValue=param.farValue
	}
	if(param.isPixelOffsetScaleByDistance){
		this.thing.isLPixelOffsetScaleByDistance=param.isPixelOffsetScaleByDistance
	}
	
	if(!this.lPrimitive){
		return;
	}
	
	if(this.thing.isLPixelOffsetScaleByDistance=='1' ){
		this.lPrimitive.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(
			this.thing.lPixelOffsetScaleByDistanceNear? this.thing.lPixelOffsetScaleByDistanceNear*1: this.position.z*1,
			this.thing.lPixelOffsetScaleByDistanceNearValue? this.thing.lPixelOffsetScaleByDistanceNearValue*1: 1,
			this.thing.lPixelOffsetScaleByDistanceFar? this.thing.lPixelOffsetScaleByDistanceFar*1: 10000,
			this.thing.lPixelOffsetScaleByDistanceFarValue? this.thing.lPixelOffsetScaleByDistanceFarValue*1: 0);
	}else{
		this.lPrimitive.pixelOffsetScaleByDistance=undefined;
	}
}


/**
 * 点
 */
VFG.PPoint.prototype.getPoint=function(){
	let param={
		id:this.id,
		pixelSize :this.thing.pSize*1||5,
		color :this.thing.pColor ? Cesium.Color.fromCssColorString(this.thing.pColor):Cesium.Color.RED,
	}
	if(this.thing.pOutlineColor){
		param.outlineColor=this.thing.pOutlineColor ? Cesium.Color.fromCssColorString(this.thing.pOutlineColor):Cesium.Color.YELLOW 
	}
	if(this.thing.pOutlineWidth){
		param.outlineWidth=this.thing.pOutlineWidth *1
	}
	param.position = this.getPosition();

	if(this.thing.isPScaleByDistance=='1' ){
		param.scaleByDistance=new Cesium.NearFarScalar(
			this.thing.pScaleByDistanceNear? this.thing.pScaleByDistanceNear*1: this.position.z*1,
			this.thing.pScaleByDistanceNearValue? this.thing.pScaleByDistanceNearValue*1: 1,
			this.thing.pScaleByDistanceFar? this.thing.pScaleByDistanceFar*1: 10000,
			this.thing.pScaleByDistanceFarValue? this.thing.pScaleByDistanceFarValue*1: 0);
	}
	
	if(this.thing.isPTranslucencyByDistance=='1' ){
		param.translucencyByDistance=new Cesium.NearFarScalar(
			this.thing.pTranslucencyByDistanceNear? this.thing.pTranslucencyByDistanceNear*1: this.position.z*1,
			this.thing.pTranslucencyByDistanceNearValue? this.thing.pTranslucencyByDistanceNearValue*1: 1,
			this.thing.pTranslucencyByDistanceFar? this.thing.pTranslucencyByDistanceFar*1: 10000,
			this.thing.pTranslucencyByDistanceFarValue? this.thing.pTranslucencyByDistanceFarValue*1: 0);
	}
	
	return param;
}


VFG.PPoint.prototype.updatePScaleByDistance=function(param){
	
	if(param.near){
		this.thing.pScaleByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.pScaleByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.pScaleByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.pScaleByDistanceFarValue=param.farValue
	}
	if(param.isScaleByDistance){
		this.thing.isPScaleByDistance=param.isScaleByDistance
	}
	
	if(!this.pPrimitive){
		return;
	}
	
	if(this.thing.isPScaleByDistance=='1' ){
		this.pPrimitive.scaleByDistance=new Cesium.NearFarScalar(
			this.thing.pScaleByDistanceNear? this.thing.pScaleByDistanceNear*1: this.position.z*1,
			this.thing.pScaleByDistanceNearValue? this.thing.pScaleByDistanceNearValue*1: 1,
			this.thing.pScaleByDistanceFar? this.thing.pScaleByDistanceFar*1: 10000,
			this.thing.pScaleByDistanceFarValue? this.thing.pScaleByDistanceFarValue*1: 0);
	}else{
		this.pPrimitive.scaleByDistance=undefined;
	}
}

VFG.PPoint.prototype.updatePTranslucencyByDistance=function(param){
	if(param.near){
		this.thing.pTranslucencyByDistanceNear=param.near
	}
	if(param.nearValue){
		this.thing.pTranslucencyByDistanceNearValue=param.nearValue
	}
	if(param.far){
		this.thing.pTranslucencyByDistanceFar=param.far
	}
	if(param.farValue){
		this.thing.pTranslucencyByDistanceFarValue=param.farValue
	}
	if(param.isTranslucencyByDistance){
		this.thing.isPTranslucencyByDistance=param.isTranslucencyByDistance
	}
	
	if(!this.pPrimitive){
		return;
	}
	
	if(this.thing.isPTranslucencyByDistance=='1' ){
		this.pPrimitive.translucencyByDistance=new Cesium.NearFarScalar(
			this.thing.pTranslucencyByDistanceNear? this.thing.pTranslucencyByDistanceNear*1: this.position.z*1,
			this.thing.pTranslucencyByDistanceNearValue? this.thing.pTranslucencyByDistanceNearValue*1: 1,
			this.thing.pTranslucencyByDistanceFar? this.thing.pTranslucencyByDistanceFar*1: 10000,
			this.thing.pTranslucencyByDistanceFarValue? this.thing.pTranslucencyByDistanceFarValue*1: 0);
	}else{
		this.pPrimitive.translucencyByDistance=undefined;
	}
}

VFG.PPoint.prototype.getPosition=function(){
	return Cesium.Cartesian3.fromDegrees(this.position.x*1,this.position.y*1,this.position.z*1);
}

VFG.PPoint.prototype.update=function(param){
	if(param.position){
		this.position=param.position;
		this.updatePosition(this.position);
	}
}

VFG.PPoint.prototype.updateName=function(param){
	this.name = param.name;
	this.code = param.code;
}

VFG.PPoint.prototype.updatePosition= function(position) {
	var _this = this;
	if(_this.position){
		this.position=position;
		if(this.bPrimitive){
			this.bPrimitive.position=this.getPosition();
		}
		if(this.pPrimitive){
			this.pPrimitive.position=this.getPosition();
		}
		if(this.lPrimitive){
			this.lPrimitive.position=this.getPosition();
		}
	}
};

VFG.PPoint.prototype.updateBShow=function(bShow){
	this.thing.bShow = bShow;
	if(this.bPrimitive){
		if("1"==this.thing.bShow){
			this.bPrimitive.show=true;
		}else{
			this.bPrimitive.show=false;
		}
	}else{
		this.bPrimitive=this.viewer.scene.primitives.get(2).add(this.getBillboard());
	}
}

VFG.PPoint.prototype.updateImage=function(param){
	this.thing.image = param.image;
	this.thing.height = param.height;
	this.thing.width = param.width;
	if(this.bPrimitive){
		this.bPrimitive.image=param.image;
		this.bPrimitive.height=param.height;
		this.bPrimitive.width=param.width;
	}
}

VFG.PPoint.prototype.updateBScale=function(scale){
	this.thing.scale = scale;
	if(this.bPrimitive){
		this.bPrimitive.scale=this.thing.scale;
	}
}


VFG.PPoint.prototype.updateLShow=function(show){
	this.thing.lShow = show;
	if(this.lPrimitive){
		if("1"==this.thing.lShow){
			this.lPrimitive.show=true;
		}else{
			this.lPrimitive.show=false;
		}
	}else{
		this.lPrimitive=this.viewer.scene.primitives.get(1).add(this.getLabel());
	}
}

VFG.PPoint.prototype.updateLBackgroundColor=function(backgroundColor){
	this.thing.lBackgroundColor = backgroundColor;
	if(this.lPrimitive){
		this.lPrimitive.backgroundColor=this.thing.lBackgroundColor ? Cesium.Color.fromCssColorString(this.thing.lBackgroundColor):Cesium.Color.YELLOW 
	}
}

VFG.PPoint.prototype.updateLShowBackground=function(showBackground){
	this.thing.lShowBackground = showBackground;
	if(this.lPrimitive){
		if('1'==this.thing.lShowBackground){
			this.lPrimitive.showBackground=true
		}else{
			this.lPrimitive.showBackground=false
		}
	}
}

VFG.PPoint.prototype.updateLStyle=function(style){
	this.thing.lStyle = style;
	if(this.lPrimitive){
		if('FILL'==this.thing.lStyle ){
			this.lPrimitive.style=Cesium.LabelStyle.FILL
		}
		if('FILL_AND_OUTLINE'==this.thing.lStyle  ){
			this.lPrimitive.style=Cesium.LabelStyle.FILL_AND_OUTLINE
		}
		if('OUTLINE'==this.thing.lStyle){
			this.lPrimitive.style=Cesium.LabelStyle.OUTLINE
		}
	}
}

VFG.PPoint.prototype.updateLOutlineWidth=function(lOutlineWidth){
	this.thing.lOutlineWidth = lOutlineWidth;
	if(this.lPrimitive){
		this.lPrimitive.outlineWidth=this.thing.lOutlineWidth *1
	}
}


VFG.PPoint.prototype.updateLOutlineColor=function(lOutlineColor){
	this.thing.lOutlineColor = lOutlineColor;
	if(this.lPrimitive){
		this.lPrimitive.outlineColor=this.thing.lOutlineColor ? Cesium.Color.fromCssColorString(this.thing.lOutlineColor):Cesium.Color.YELLOW 
	}
}

VFG.PPoint.prototype.updateLHorizontalOrigin=function(lHorizontalOrigin){
	this.thing.lHorizontalOrigin = lHorizontalOrigin;
	if(this.lPrimitive){
		if('CENTER'==this.thing.lHorizontalOrigin){
			this.lPrimitive.horizontalOrigin=Cesium.HorizontalOrigin.CENTER
		}
		
		if('LEFT'==this.thing.lHorizontalOrigin){
			this.lPrimitive.horizontalOrigin=Cesium.HorizontalOrigin.LEFT 
		}
		
		if('RIGHT'==this.thing.lHorizontalOrigin){
			this.lPrimitive.horizontalOrigin=Cesium.HorizontalOrigin.RIGHT
		}
	}
}

VFG.PPoint.prototype.updateLVerticalOrigin=function(lVerticalOrigin){
	this.thing.lVerticalOrigin = lVerticalOrigin;
	if(this.lPrimitive){
		if('BASELINE'==this.thing.lVerticalOrigin ){
			this.lPrimitive.verticalOrigin=Cesium.VerticalOrigin.BASELINE 
		}
		if('BOTTOM'==this.thing.lVerticalOrigin ){
			this.lPrimitive.verticalOrigin=Cesium.VerticalOrigin.BOTTOM 
		}
		if('CENTER'==this.thing.lVerticalOrigin ){
			this.lPrimitive.verticalOrigin=Cesium.VerticalOrigin.CENTER  
		}
		if('TOP'==this.thing.lVerticalOrigin ){
			this.lPrimitive.verticalOrigin=Cesium.VerticalOrigin.TOP  
		}
	}
}

VFG.PPoint.prototype.updateLScale=function(lScale){
	this.thing.lScale = lScale;
	if(this.lPrimitive){
		this.lPrimitive.scale=this.thing.lScale*1
	}
}

VFG.PPoint.prototype.updateLFontSize=function(fontSize){
	this.thing.lFontSize = fontSize;
	if(this.lPrimitive){
		try{
			this.lPrimitive.font=(this.thing.lFontSize?this.thing.lFontSize:'13px') +" "+(this.thing.lFontFamily?this.thing.lFontFamily:'sans-serif')
		}catch (e) {
		}
	}
}

VFG.PPoint.prototype.updateLFontFamily=function(lFontFamily){
	this.thing.lFontFamily = lFontFamily;
	if(this.lPrimitive){
		try{
			this.lPrimitive.font=(this.thing.lFontSize?this.thing.lFontSize:'13px') +" "+(this.thing.lFontFamily?this.thing.lFontFamily:'sans-serif')
		}catch (e) {
		}
	}
}

VFG.PPoint.prototype.updateLPOffset=function(lPOffsetX,lPOffsetY){
	this.thing.lPOffsetX = lPOffsetX;
	this.thing.lPOffsetY = lPOffsetY;
	if(this.lPrimitive){
		this.lPrimitive.pixelOffset=new Cesium.Cartesian2(this.thing.lPOffsetX*1,this.thing.lPOffsetY*1);
		this.lPrimitive.pixelOffsetScaleByDistance=new Cesium.NearFarScalar(this.position.z*1, 1,5000, 0.0);
	}
}

////////////////////////////////////////////
VFG.PPoint.prototype.updatePShow=function(show){
	this.thing.pShow = show;
	if(this.pPrimitive){
		if("1"==this.thing.pShow){
			this.pPrimitive.show=true;
		}else{
			this.pPrimitive.show=false;
		}
	}else{
		this.pPrimitive=this.viewer.scene.primitives.get(0).add(this.getPoint());
	}
}

VFG.PPoint.prototype.updatePOutlineColor=function(pOutlineColor){
	this.thing.pOutlineColor = pOutlineColor;
	if(this.pPrimitive){
		this.pPrimitive.outlineColor=this.thing.pOutlineColor ? Cesium.Color.fromCssColorString(this.thing.pOutlineColor):Cesium.Color.YELLOW 
	}
}

VFG.PPoint.prototype.updatePOutlineWidth=function(pOutlineWidth){
	this.thing.pOutlineWidth = pOutlineWidth;
	if(this.pPrimitive){
		this.pPrimitive.outlineWidth=this.thing.pOutlineWidth *1
	}
}

VFG.PPoint.prototype.updatePColor=function(pColor){
	this.thing.pColor = pColor;
	if(this.pPrimitive){
		this.pPrimitive.color =this.thing.pColor ? Cesium.Color.fromCssColorString(this.thing.pColor):Cesium.Color.RED;
	}
}

VFG.PPoint.prototype.updatePSize=function(pSize){
	this.thing.pSize = pSize;
	if(this.pPrimitive){
		this.pPrimitive.pixelSize =this.thing.pSize*1||5;
	}
}


VFG.PPoint.prototype.updateProperty= function(property) {
	var _this = this;
	if(_this.propertys){
		for(let index in _this.propertys){
			if(property.id==_this.propertys[index].id){
				_this.propertys.splice(index,1,property);
				return;
			}
		}
		_this.propertys.push(property);
	}
};

VFG.PPoint.prototype.removeProperty= function(id) {
	var _this = this;
	if(_this.propertys){
		for(let index in _this.propertys){
			if(id==_this.propertys[index].id){
				_this.propertys.splice(index,1);
				return;
			}
		}
	}
};

VFG.PPoint.prototype.destroy = function() {
	let _this=this;
	if(_this.bPrimitive){
		this.viewer.scene.primitives.get(2).remove(_this.bPrimitive);
	}
	if(_this.lPrimitive){
		this.viewer.scene.primitives.get(1).remove(_this.lPrimitive);
	}
	if(_this.pPrimitive){
		this.viewer.scene.primitives.get(0).remove(_this.pPrimitive);
	}
	
	delete this.position
	delete this.primity
	delete this.options
	delete this.model
    delete this.viewer
	return Cesium.destroyObject(this);
};
